import request from '@/utils/request'

// 认证相关 API 封装
// 统一前缀：/auth/*

// 获取验证码
export function getCaptcha() {
  return request({
    url: '/auth/captcha',
    method: 'get',
    params: { t: Date.now() },
  })
}

// 登录
export function login(data) {
  return request({
    url: '/auth/login',
    method: 'post',
    data,
  })
}

// 注册
export function register(data) {
  return request({
    url: '/auth/register',
    method: 'post',
    data,
  })
}

// 退出登录
export function logout() {
  return request({
    url: '/auth/logout',
    method: 'post'
  })
}
